<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增生产型号')" />
    <th:block th:include="include :: bootstrap-fileinput-css"/>
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-erpModel-add">
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">生产型号：</label>
                <div class="col-sm-8">
                    <input name="modeNo" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label is-required">生产型号名称：</label>
                <div class="col-sm-8">
                    <input name="modeName" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">产品分类：</label>
                <div class="col-sm-8">
                    <select name="modeType" class="form-control m-b" th:with="type=${@dict.getType('erp_mode_type')}" required>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">生产pcb文件：</label>
                <div class="col-sm-8">
                    <input type="hidden" name="pcbFile">
                    <div class="file-loading">
                        <input class="form-control file-upload" id="pcbFile" name="file" type="file">
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">生产机器文件：</label>
                <div class="col-sm-8">
                    <input type="hidden" name="machineFile">
                    <div class="file-loading">
                        <input class="form-control file-upload" id="machineFile" name="file" type="file">
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">长度：</label>
                <div class="col-sm-8">
                    <input name="length" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">宽度：</label>
                <div class="col-sm-8">
                    <input name="wide" class="form-control" type="text" required>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">版厚：</label>
                <div class="col-sm-8">
                    <select name="thickness" class="form-control m-b" th:with="type=${@dict.getType('erp_thickness')}" required>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">层数：</label>
                <div class="col-sm-8">
                    <select name="layerNum" class="form-control m-b" th:with="type=${@dict.getType('erp_layer_num')}" required>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">基材：</label>
                <div class="col-sm-8">
                    <select name="baseMaterial" class="form-control m-b" th:with="type=${@dict.getType('erp_baseMaterial')}" required>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">外层铜厚：</label>
                <div class="col-sm-8">
                    <select name="outerThickness" class="form-control m-b" th:with="type=${@dict.getType('erp_outerThickness')}" required>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">内层铜厚：</label>
                <div class="col-sm-8">
                    <select name="innerThickness" class="form-control m-b" th:with="type=${@dict.getType('erp_outerThickness')}" required>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">焊盘喷镀：</label>
                <div class="col-sm-8">
                    <select name="solderCoating" class="form-control m-b" th:with="type=${@dict.getType('erp_solderCoating')}" required>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">阻焊颜色：</label>
                <div class="col-sm-8">
                    <select name="solderColor" class="form-control m-b" th:with="type=${@dict.getType('erp_solderColor')}" required>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">字符颜色：</label>
                <div class="col-sm-8">
                    <select name="characterColor" class="form-control m-b" th:with="type=${@dict.getType('erp_characterColor')}" required>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">成形：</label>
                <div class="col-sm-8">
                    <select name="shapingStyle" class="form-control m-b" th:with="type=${@dict.getType('erp_shapingStyle')}" required>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">测试：</label>
                <div class="col-sm-8">
                    <select name="testStyle" class="form-control m-b" th:with="type=${@dict.getType('erp_testStyle')}" required>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label is-required">过孔：</label>
                <div class="col-sm-8">
                    <select name="viaHole" class="form-control m-b" th:with="type=${@dict.getType('erp_viaHole')}" required>
                        <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                    </select>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">规格：</label>
                <div class="col-sm-8">
                    <input name="spec" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">单元尺寸：</label>
                <div class="col-sm-8">
                    <input name="unitSize" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">拼版尺寸：</label>
                <div class="col-sm-8">
                    <input name="makeUpSize" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">拼板款数：</label>
                <div class="col-sm-8">
                    <input name="makeModeNum" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">是否阻抗：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('sys_yes_no')}">
                        <input type="radio" th:id="${'isImpedance_' + dict.dictCode}" name="isImpedance" th:value="${dict.dictValue}" th:checked="${dict.default}">
                        <label th:for="${'isImpedance_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">阻焊覆盖：</label>
                <div class="col-sm-8">
                    <input name="solderCover" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">最小孔径：</label>
                <div class="col-sm-8">
                    <input name="minAperture" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">外径：</label>
                <div class="col-sm-8">
                    <input name="outerDiameter" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">线路测试：</label>
                <div class="col-sm-8">
                    <input name="lineTest" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">否需要斜边：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('sys_yes_no')}">
                        <input type="radio" th:id="${'hypotenuse_' + dict.dictCode}" name="hypotenuse" th:value="${dict.dictValue}" th:checked="${dict.default}">
                        <label th:for="${'hypotenuse_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <textarea name="remark" class="form-control"></textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: bootstrap-fileinput-js"/>
    <script th:inline="javascript">
        var prefix = ctx + "erp/erpModel"
        $("#form-erpModel-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-erpModel-add').serialize());
            }
        }

        $(".file-upload").fileinput({
            uploadUrl: ctx + 'common/upload',
            maxFileCount: 1,
            autoReplace: true
        }).on('fileuploaded', function (event, data, previewId, index) {
            $("input[name='" + event.currentTarget.id + "']").val(data.response.url)
        }).on('fileremoved', function (event, id, index) {
            $("input[name='" + event.currentTarget.id + "']").val('')
        })
    </script>
</body>
</html>